<?php
  require '../../include/library.inc.php';
  require '../../include/admin_login.inc.php';
    
  $user_id = intval($_GET['user_id']);
  $publish = intval($_GET['publish']);
  
  if($user_id) {
	  if($user_id == '1')
	  {
		  $_SESSION['message'] = 'Не може да промените правата на главния администратор!';
	  }else{
		$sql = "UPDATE 
				  users
				SET
				  published = $publish
				WHERE
				  user_id = '$user_id'
				 ";
		query($sql);
	  }
  }
  
  redirect($_SERVER['HTTP_REFERER']);
?>